package com.nlx.notes.module.service.impl.gold;

import com.nlx.notes.module.bean.vo.gold.GoldPriceMetricsVO;
import com.nlx.notes.module.service.gold.GoldDynamicService;
import com.nlx.notes.support.helper.gold.GoldPriceCalculateHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Slf4j
@Service
public class GoldDynamicServiceImpl implements GoldDynamicService {


    @Override
    public GoldPriceMetricsVO getCurrentGoldPriceMetrics() {
        BigDecimal currentGoldPrice = GoldPriceCalculateHelper.getCurrentGoldPrice();
        GoldPriceMetricsVO goldPriceMetricsVO = new GoldPriceMetricsVO();
        goldPriceMetricsVO.setCurrentPrice(currentGoldPrice.toString());
        return goldPriceMetricsVO;
    }
}
